From 0d9a45d46006cf03afc1868130005736cf5a2d0c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 8 Nov 2012 23:15:19 +0100 Subject: [PATCH] label: Fix another sizing corner case causing segfaults If the "wider" label is the smaller one, use the wider size for both cases. This can happen when ellipsizing a single character, which is often smaller than the ellipsizing glpyph(s). --- gtk/gtklabel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index a3c92838a7..92f55b6c14 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -3557,7 +3557,8 @@ gtk_label_get_preferred_layout_size (GtkLabel *label, *smallest = *widest; } - g_assert (widest->width >= smallest->width); + if (widest->width < smallest->width) + *smallest = *widest; g_object_unref (layout); } -- 2.30.2